package com.hyg.hometown.model;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

@Entity
@Table(name = "role")
public class Role implements Serializable {
    @Id
    private String id;
    //角色名
    private String name;
    //描述
    private String description;
    //是否可见
    private String available;
    //jpa的数据查询
    @ManyToMany(fetch = FetchType.EAGER)
    @JoinTable(name = "role_persission_relation",joinColumns = {@JoinColumn(name = "roleid")},inverseJoinColumns = {@JoinColumn(name = "perssion_id")})
    private List<Permission> permissionList;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getAvailable() {
        return available;
    }

    public void setAvailable(String available) {
        this.available = available;
    }

    public List<Permission> getPermissionList() {
        return permissionList;
    }

    public void setPermissionList(List<Permission> permissionList) {
        this.permissionList = permissionList;
    }
}
